import request from '@/utils/request'

// 获取规则列表
export function getRules(params) {
    return request({
        url: '/exam-rules',
        method: 'get',
        params
    })
}

// 获取规则详情
export function getRule(id) {
    return request({
        url: `/exam-rules/${id}`,
        method: 'get'
    })
}

// 新增规则
export function addRule(data) {
    return request({
        url: '/exam-rules',
        method: 'post',
        data
    })
}

// 修改规则
export function updateRule(id, data) {
    return request({
        url: `/exam-rules/${id}`,
        method: 'put',
        data
    })
}

// 删除规则
export function deleteRule(id) {
    return request({
        url: `/exam-rules/${id}`,
        method: 'delete'
    })
}

// 启用规则
export function enableRule(id) {
    return request({
        url: `/exam-rules/${id}/enable`,
        method: 'post'
    })
}

// 禁用规则
export function disableRule(id) {
    return request({
        url: `/exam-rules/${id}/disable`,
        method: 'post'
    })
} 